package com.lc.cn.managersys.common;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * page
 * @author luo_guang
 *
 */
public class Page implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private int curPage = 1;
	private int pageSize = 100;
	private int count;
	private int totalPages;
	private List<Map<String, Object>> list;
	
	public Page(int curPage, int pageSize) {
		this.curPage = curPage;
		this.pageSize = pageSize;
	}
	
	public Page(int curPage, String query) {
		this(curPage, 100);
	}

	public int getCurPage() {
		return curPage;
	}

	public void setCurPage(int curPage) {
		this.curPage = curPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
		totalPages = (count%pageSize == 0) ? (count/pageSize) : (count/pageSize + 1);
	}


	public List<Map<String, Object>> getList() {
		return list;
	}

	public void setList(List<Map<String, Object>> list) {
		this.list = list;
	}

	public int getTotalPages() {
		return totalPages;
	}

}
